package com.tuanzhang.mall.goods.domain.valueobj;

import com.tuanzhang.mall.seller.types.exception.ApiException;
import lombok.Getter;

@Getter
public class Category {

    private Long categoryId;

    private Category() {

    }

    private Category(Long categoryId) {
        if (categoryId == null) {
            throw new ApiException("categoryId不能为空");
        }
        this.categoryId = categoryId;
    }

    public static Category create(Long categoryId) {
       return new Category(categoryId);
    }
}